/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pl.edu.amu.wmi.kino.visualjavafx.javafxcodegenerators.object;


import pl.edu.amu.wmi.kino.visualjavafx.javafxcodegenerators.api.Generator;
import pl.edu.amu.wmi.kino.visualjavafx.javafxcodegenerators.helpergenerators.ContentGenerator;
import pl.edu.amu.wmi.kino.visualjavafx.javafxcodegenerators.helpergenerators.EndGenerator;
import pl.edu.amu.wmi.kino.visualjavafx.javafxcodegenerators.helpergenerators.TimelineVarGenerator;
import pl.edu.amu.wmi.kino.visualjavafx.javafxcodegenerators.helpergenerators.TransformGenerator;
import pl.edu.amu.wmi.kino.visualjavafx.javafxcodegenerators.helpergenerators.VisibleGenerator;
import pl.edu.amu.wmi.kino.visualjavafx.javafxcodegenerators.object.interfaces.Generatable;
import pl.edu.amu.wmi.kino.visualjavafx.model.animation.transformations.Movable;
import pl.edu.amu.wmi.kino.visualjavafx.model.animation.transformations.Showable;
import pl.edu.amu.wmi.kino.visualjavafx.model.objects.ContentContainer;
import pl.edu.amu.wmi.kino.visualjavafx.model.objects.Group;
import pl.edu.amu.wmi.kino.visualjavafx.model.objects.VisualObject;

/**
 *
 * @author Admin
 */
public class GroupGenerator implements Generator,Generatable
{

    @Override
    public boolean canGenerate(Object c) {
        if(c instanceof Group)
            return true;
        else return false;
    }


    @Override
    public void generate(StringBuilder sb, Object o,int recursionLevel,Object original) {
        this.generateStart(sb);
        this.generateUniqueAttributes(sb, (Group)o,recursionLevel);
        VisibleGenerator.generateVisibleAttribute(sb, recursionLevel);
        VisibleGenerator.generateVisibleVar(sb, (Showable)o, recursionLevel);
        TimelineVarGenerator.generateTimeline(sb, (VisualObject)o, recursionLevel,original);
        TransformGenerator.generateTransformAttributes(sb, recursionLevel);
        TransformGenerator.generateTransformVars(sb, (Movable)o, recursionLevel);
        ContentGenerator.generateContent(sb,(ContentContainer)o, recursionLevel,original);
        this.generateEnd(sb);
    }
    @Override
    public void generateStart(StringBuilder sb){
        sb.append("SuperGroup{\n");
    }

    @Override
    public void generateEnd(StringBuilder sb) {
        EndGenerator.generateEnd(sb);
    }

    @Override
    public void generateUniqueAttributes(StringBuilder sb,Object g,int recursionLevel){
        
    }
    

}
